//JS是一个弱类型的脚本语言

//声明一个对象
//将会在内存当中开辟一个空间
const hxt = {
    height: 188,
    weight: 188,
    age: 20,
    say: function () {
        console.log('say');
    }
}
// js 是否灵活 可以随意的申请对象
const pyc = {
    name: '彭奕淳', //k-v
    age: 20, //Number 数值类型
    isSingle: true, //Boolean 布尔类型
    hometown: '新余',
    //送花
    sendFlower: function(girl){
        console.log("送花给" + girl.name + "了");
        girl.receiceFlower(pyc);
    }
}
const xm = {
    xq: 40,
    name: '小美',
    room: '408',
    receiceFlower: function(sender) {
        console.log(this.name + "收到了花");
        if(this.xq >= 90){
            console.log("出去玩吧"); 
        }else{
            console.log("gun!!!");
        }
    }
}
const xh = {
    xq: 30,
    name: '小红',
    hometown: '新余',
    room: '408',
    receiceFlower: function(sender) {
        setTimeout(() => {
            xm = 90;
            xm.receiceFlower(sender);
        }, 3000);
    }
}
pyc.sendFlower(xh);

